﻿@{
    ViewBag.Title = "导航栏维护";
    Layout = "~/Areas/Admin/Views/Shared/_RightLayout.cshtml";
}
<script>
    function toggleEC(obj) {
        var item = $(obj);
        var sid = item.attr("rel");
        var ec = item.attr("ec");
        if (ec == "0") {
            $("tr[rev=" + sid + "]").show();
            item.attr("ec", "1");
            item.html("折叠");
        }
        else {
            $("tr[rev=" + sid + "]").hide();
            item.attr("ec", "0");
            item.html("展开");
        }


    }

</script>
	<form id="listForm" method="get" action="/admin/Left_navigation/List/">
	<div id="toolBar">
        <a class="add" href="/admin/Left_navigation/Edit?classid=@Request.QueryString["classid"]"><span>添加</span></a>
		<a class="delete" href="javascript:void()" rel="/admin/Left_navigation/Delete?classid=@Request.QueryString["classid"]"><span>删除</span></a>
	</div>
	<div id="list">
		<table>
			<tr>
                <th></th>
                <th style="width: 25px;" align="center" title="全选/取消">
                    <input type="checkbox" id="select_all" onclick="sel_all()"/>
                </th>
                <th>简体中文</th>
                <th>繁体中文</th>
                <th>英文</th>
                <th>Url</th>
                <th>父导航</th>
                <th>Target</th>
                <th>创建者</th>
                <th>更新者</th>
                <th>显示顺序</th>
                <th class="thDateTime">
                    最后更新时间
                </th>
                <th class="thDateTime">
                    创建时间
                </th>
                <th style="width: 60px;" align="center">
                    操作
                </th>
            </tr>
            @foreach (var data in ViewBag.LeftNavigations)
            {
            <tr>
                <td>
                    <span onclick="toggleEC(this)" rel="@data.Id" ec="0">展开</span>
                </td>
                <td align="center"><input type="checkbox" name="ids" value="@data.Id" /></td>
                <td>@data.zh_cn</td>
                <td>@data.zh_tw</td>
                <td>@data.en_us</td>
                <td>@data.Url</td>
                <td>@data.parent</td>
                <td>@data.Target</td>
                <td>@data.CreateBy</td>
                <td>@data.UpdateBy</td>
                <td>@data.DisplayOrder</td>
                <td class="tdDateTime">@data.UpdateDate</td>
                <td class="tdDateTime">@data.CreateDate</td>
                <td>
                    <a href="/admin/Left_navigation/Edit/@data.Id?classid=@Request.QueryString["classid"]" title="修改tb_left_navigation" >修改</a>
                    <a href="/admin/Left_navigation/Detail/@data.Id?classid=@Request.QueryString["classid"]" title="查看tb_left_navigation详细信息" >详细</a>
                </td>
            </tr>
                foreach (var childLN in Odyssey.Web.Areas.Admin.Models.ViewHelper.GetChildNavigaitnos(ViewBag.ChildLeftNavigations, data.Id))
                {
            <tr rev="@data.Id" style="display:none;">
                <td></td>
                <td align="center"><input type="checkbox" name="ids" value="@childLN.Id" /></td>
                <td>@childLN.zh_cn</td>
                <td>@childLN.zh_tw</td>
                <td>@childLN.en_us</td>
                <td>@childLN.Url</td>
                <td>@childLN.parent</td>
                <td>@childLN.Target</td>
                <td>@childLN.CreateBy</td>
                <td>@childLN.UpdateBy</td>
                <td>@childLN.DisplayOrder</td>
                <td class="tdDateTime">@childLN.UpdateDate</td>
                <td class="tdDateTime">@childLN.CreateDate</td>
                <td>
                    <a href="/admin/Left_navigation/Edit/@childLN.Id?classid=@Request.QueryString["classid"]" title="修改tb_left_navigation" >修改</a>
                    <a href="/admin/Left_navigation/Detail/@childLN.Id?classid=@Request.QueryString["classid"]" title="查看tb_left_navigation详细信息" >详细</a>
                </td>
            </tr>
                }
            }
		</table>
	</div>
	</form>
